package light.head.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Formula;
/**
 *	招聘留言
 */
@Entity
@Table
public class RecruitJoin implements Serializable{
	private static final long serialVersionUID = -1526070582749091999L;
	private Integer code;				//流水号
	private Integer rc;					//招聘信息编号
	private String name;				//联系人
	private String phone;				//联系电话
	private String remark;				//留言
	private Integer count = 0;				//简历数量
	private List<RecruitAnnex> list;	//简历

	

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	@Column
	public Integer getRc() {
		return rc;
	}
	@Column
	public String getName() {
		return name;
	}
	@Column
	public String getPhone() {
		return phone;
	}
	@Column(length = 3000)
	public String getRemark() {
		return remark;
	}
	@Formula("(SELECT COUNT(*) FROM RecruitAnnex ra WHERE ra.rjc = code )")
	public Integer getCount() {
		return count;
	}
	@Transient
	public List<RecruitAnnex> getList() {
		return list;
	}
	
	public void setCode(Integer code) {
		this.code = code;
	}
	public void setRc(Integer rc) {
		this.rc = rc;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public void setCount(Integer count) {
		this.count = count;
	}
	public void setList(List<RecruitAnnex> list) {
		this.list = list;
	}
	
}
